.switch {
  position: relative;
  display: inline-flex;
  align-items: center;

  input {
    opacity: 0;
    width: 2rem;
    height: 0;
    margin: 0;

    &:checked + .slider {
      &:before {
        left: 56.25%;
        right: 6.25%;
      }
      background-color: var(--text-link);
    }

    &:focus-visible + .slider {
      outline-style: auto;
      outline-color: var(--accent-primary);
      outline-offset: 1px;
    }
  }

  .slider {
    position: absolute;
    cursor: pointer;
    background-color: var(--text-secondary);
    transition: 0.4s;
    border-radius: 1em;
    width: 2rem;
    height: 1rem;

    &:before {
      position: absolute;
      content: "";
      left: 6.25%;
      right: 56.25%;
      top: 12.5%;
      bottom: 12.5%;
      background-color: var(--background-primary);
      transition: 0.4s;
      border-radius: 50%;
    }
  }

  .label {
    margin-left: 0.5rem;
  }
}
